package com.av.android;
//import java.awt.image.*;

import java.io.Serializable;
import java.util.Date;


public class Report implements Serializable{
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private long report_id;
	private String reportName;
	private long user_id;
	private long obstacle_id;
	private double latitude;
	private double longitude;
	private int imageNum;
	private int status;
	private String description;
	private int rate;
	private Date created_on;
	private Date updateTime;
	
	
	public Report() {};
	
	
	
	
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((created_on == null) ? 0 : created_on.hashCode());
		result = prime * result
				+ ((description == null) ? 0 : description.hashCode());
		result = prime * result + imageNum;
		long temp;
		temp = Double.doubleToLongBits(latitude);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		temp = Double.doubleToLongBits(longitude);
		result = prime * result + (int) (temp ^ (temp >>> 32));
		result = prime * result + (int) (obstacle_id ^ (obstacle_id >>> 32));
		result = prime * result + rate;
		result = prime * result
				+ ((reportName == null) ? 0 : reportName.hashCode());
		result = prime * result + (int) (report_id ^ (report_id >>> 32));
		result = prime * result + status;
		result = prime * result
				+ ((updateTime == null) ? 0 : updateTime.hashCode());
		result = prime * result + (int) (user_id ^ (user_id >>> 32));
		return result;
	}




	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Report other = (Report) obj;
		if (created_on == null) {
			if (other.created_on != null)
				return false;
		} else if (!created_on.equals(other.created_on))
			return false;
		if (description == null) {
			if (other.description != null)
				return false;
		} else if (!description.equals(other.description))
			return false;
		if (imageNum != other.imageNum)
			return false;
		if (Double.doubleToLongBits(latitude) != Double
				.doubleToLongBits(other.latitude))
			return false;
		if (Double.doubleToLongBits(longitude) != Double
				.doubleToLongBits(other.longitude))
			return false;
		if (obstacle_id != other.obstacle_id)
			return false;
		if (rate != other.rate)
			return false;
		if (reportName == null) {
			if (other.reportName != null)
				return false;
		} else if (!reportName.equals(other.reportName))
			return false;
		if (report_id != other.report_id)
			return false;
		if (status != other.status)
			return false;
		if (updateTime == null) {
			if (other.updateTime != null)
				return false;
		} else if (!updateTime.equals(other.updateTime))
			return false;
		if (user_id != other.user_id)
			return false;
		return true;
	}


	
	
	public Report(long r_id, String r_Name, long u_id, long o_id, double lat, double lng, 
			 int stat, int i_num, String desc)
	{
		report_id = r_id;
		reportName = r_Name;
		user_id = u_id;
		obstacle_id = o_id;
		latitude = lat;
		longitude = lng;
		status = stat;
		imageNum = i_num;
		description = desc;
		rate=0;
	}
	
	public void setAll(long r_id, String r_Name, long u_id, long o_id, double lat, double lng, 
			 int stat, int i_num, String desc, Date c_on, Date u_on, int rate)
	{
		setReport_id(r_id);
		setReportName(r_Name);
		setUser_id(u_id);
		setObstacle_id(o_id);
		setLatitude(lat);
		setLongitude(lng);
		setStatus(stat);
		setImageNum(i_num);
		setDescription(desc);
		setCreated_on(c_on);
		setUpdated_on(u_on);
		setRate(rate);
		
	}
	public String getReportName() {
		return reportName;
	}

	public void setReportName(String reportName) {
		this.reportName= reportName;
	}
	public long getReport_id() {
		return report_id;
	}

	public void setReport_id(long report_id) {
		this.report_id = report_id;
	}

	public long getUser_id() {
		return user_id;
	}

	public void setUser_id(long user_id) {
		this.user_id = user_id;
	}

	public Date getCreated_on() {
		return created_on;
	}

	public void setCreated_on(Date created_on) {
		this.created_on = created_on;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public int getRate() {
		return rate;
	}

	public void setRate(int rate) {
		this.rate = rate;
	}

	public Date getUpdated_on() {
		return updateTime;
	}

	public void setUpdated_on(Date updateTime) {
		this.updateTime = updateTime;
	}

	public long getObstacle_id() {
		return obstacle_id;
	}

	public void setObstacle_id(long obstacle_id) {
		this.obstacle_id = obstacle_id;
	}

	public double getLatitude() {
		return latitude;
	}

	public void setLatitude(double latitude) {
		this.latitude = latitude;
	}

	public double getLongitude() {
		return longitude;
	}

	public void setLongitude(double longitude) {
		this.longitude = longitude;
	}

	public int getImageNum() {
		return imageNum;
	}

	public void setImageNum(int imageNum) {
		this.imageNum = imageNum;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	
	

}
